package spider.task;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import spider.service.DeviceFailureService;
import spider.service.DeviceListService;
import spider.service.DeviceMetricsService;
import spider.service.DeviceWorkTimeService;
import java.util.TimerTask;

/**
 * Created by 李延念 on 2018/4/27.
 */
public class UpdateDataTask extends TimerTask{
    private static Logger logger = LogManager.getLogger(UpdateDataTask.class);

    @Override
    public void run() {
        logger.info(" Update Data Task start ");
        DeviceListService.updateTZDeviceList();
        DeviceListService.updateTZTenantIdDeviceId();
        DeviceFailureService.updateDeviceFailure();
        DeviceWorkTimeService.updateWorkTime();
        DeviceMetricsService.getMetricDatasFromTZToKafka();
        DeviceMetricsService.getMetricStatussFromTZToMysql();
        logger.info(" Update Data Task end ");
     }
}
